<template>
  <div class="section-body">
    <div
      class="coupon-box"
      v-show="
        propsData.params.styleType == 1 || propsData.params.styleType == 2
      "
    >
      <div class="coupon-bg">
        <img
          v-show="propsData.params.styleType == 1"
          :src="propsData.params.couponPic"
          alt=""
        />
        <div
          class="card-bg"
          :style="{ background: propsData.params.colorConfig.bgColor }"
          v-show="propsData.params.styleType == 2"
        >
          <div class="white-line"></div>
          <div
            class="dashed-line"
            :style="{ borderColor: propsData.params.colorConfig.breakLine }"
          ></div>
          <div
            class="top-circle"
            :style="
              propsData.moduleCss.useBackground ? propsData.moduleCss : ''
            "
          ></div>
          <div
            class="down-circle"
            :style="
              propsData.moduleCss.useBackground ? propsData.moduleCss : ''
            "
          ></div>
        </div>
      </div>
      <div
        class="coupon-content"
        :class="propsData.params.styleType == 2 ? 'style-card' : ''"
      >
        <div
          class="price"
          :style="{ color: propsData.params.colorConfig.priceColor }"
        >
          <span>¥</span>
          <span>&nbsp;99</span>
        </div>
        <div
          class="info"
          :style="{ color: propsData.params.colorConfig.infoColor }"
        >
          <p>测试优惠券</p>
          <p>2021.8.9到期</p>
        </div>
        <div
          class="receive"
          :style="{ borderColor: propsData.params.colorConfig.btnColor }"
        >
          <span :style="{ color: propsData.params.colorConfig.btnColor }"
            >立即领取</span
          >
        </div>
      </div>
    </div>
    <div class="absolute-coupon" v-show="propsData.params.styleType == 3">
      <div
        class="absolute-coupon-bg"
        :style="{ background: propsData.params.colorConfig.bgColor }"
      ></div>
      <div class="absolute-coupon-content">
        <div class="top-circle"></div>
        <div class="down-circle" :style="{ backgroundColor: propsData.params.colorConfig.bgColor }"></div>
        <div
          class="price"
          :style="{ color: propsData.params.colorConfig.priceColor }"
        >
          <span>¥</span>
          <span>&nbsp;99</span>
        </div>
        <div
          class="info"
          :style="{ color: propsData.params.colorConfig.infoColor }"
        >
          <p>测试优惠券</p>
          <p>2021.8.9到期</p>
        </div>
        <div class="receive">
          <span :style="{ color: propsData.params.colorConfig.btnColor }"
            >立即领取</span
          >
          <i class="iconfont icon-weibiaoti-13"></i>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.section-body {
  .coupon-box {
    width: 100%;
    height: 92px;
    position: relative;
    .coupon-bg {
      width: 100%;
      height: 100%;
      img {
        width: 100%;
        height: 100%;
        display: block;
      }
      .card-bg {
        width: 100%;
        height: 92px;
        background: linear-gradient(90deg, #ffb85c 0%, #ff7734 100%);
        border-radius: 10px;
        position: relative;
        .white-line {
          width: 1px;
          height: 86px;
          background-color: #ffffff;
          position: absolute;
          left: 96px;
          top: 3px;
        }
        .dashed-line {
          height: 75px;
          border: 1px dashed #e87531;
          position: absolute;
          left: 103px;
          top: 8.5px;
        }
        .top-circle,
        .down-circle {
          width: 12px;
          height: 12px;
          background-color: #ffffff;
          border-radius: 50% !important;
          position: absolute;
          left: 94px;
          top: -6px;
          display: none;
        }
        .down-circle {
          bottom: -6px;
          top: inherit;
        }
      }
    }
    .coupon-content {
      width: 100%;
      height: 100%;
      position: absolute;
      left: 0;
      top: 0;
      z-index: 11;
      display: flex;
      align-items: center;
      padding: 0 3.46% 0 9.6%;
      .price {
        font-size: 30px;
        font-weight: bold;
        color: #ec2827;
        display: flex;
        align-items: baseline;
        line-height: 1;

        span:first-child {
          font-size: 16px;
        }
      }
      .info {
        color: #ffffff;
        line-height: 20px;
        flex: 1;
        text-align: left;
        padding-left: 14.93%;
        p:first-child {
          margin-bottom: 2px;
          font-size: 16px;
          font-weight: bold;
        }
        p:last-child {
          margin-bottom: 0;
          font-size: 14px;
        }
      }
      .receive {
        width: 62px;
        height: 62px;
        background: linear-gradient(
          180deg,
          #ffefd0 0%,
          #ffe2b6 50%,
          #fed59b 100%
        );
        border-radius: 50%;
        opacity: 0.91;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        span {
          width: 32px;
          font-size: 16px;
          color: #ec2827;
          line-height: 20px;
        }
      }
    }
    .style-card {
      padding: 0 18px 0 21px;
      .price {
        color: #ffffff;
      }
      .receive {
        width: 74px;
        height: 26px;
        border: 1px solid #ffffff;
        border-radius: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: none;
        text-align: center;
        span {
          font-size: 14px;
          color: #ffffff;
          width: inherit;
          line-height: normal;
        }
      }
    }
  }
  .absolute-coupon {
    width: 100%;
    height: 92px;
    position: relative;
    padding-top: 7px;
    .absolute-coupon-bg {
      width: 98%;
      height: 85px;
      background-color: #ffcb3f;
      margin-left: 7px;
    }
    .absolute-coupon-content {
      width: 98%;
      height: 85px;
      background: #ffffff;
      border: 1px solid #666666;
      position: absolute;
      left: 0;
      top: 0;
      padding: 0 5.6% 0 6.4%;
      display: flex;
      align-items: center;
      .top-circle {
        width: 12px;
        height: 12px;
        background-color: #ffffff;
        border-bottom: 1px solid #666666;
        border-radius: 50%;
        position: absolute;
        left: 92px;
        top: -6px;
        display: none;
      }
      .down-circle {
        width: 12px;
        height: 12px;
        background-color: #ffcb3f;
        border-top: 1px solid #666666;
        border-radius: 50%;
        position: absolute;
        left: 92px;
        bottom: -6px;
      }
      .price {
        font-size: 30px;
        font-weight: bold;
        color: #ffcb3f;
        display: flex;
        align-items: baseline;
        line-height: 1;

        span:first-child {
          font-size: 16px;
        }
      }
      .info {
        color: #404040;
        line-height: 20px;
        flex: 1;
        text-align: left;
        padding-left: 12%;
        p:first-child {
          margin-bottom: 2px;
          font-size: 16px;
          font-weight: bold;
        }
        p:last-child {
          margin-bottom: 0;
          font-size: 14px;
        }
      }
      .receive {
        width: 56px;
        display: flex;
        align-items: center;
        height: 62px;
        border-left: 1px solid #cccccc;
        padding-left: 21px;
        span {
          width: 24px;
          font-size: 12px;
          font-family: PingFang SC;
          color: #404040;
          margin-right: 7px;
          flex-shrink: 0;
        }
        .iconfont {
          font-size: 10px;
        }
      }
    }
  }
}
</style>
